<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<sec:authentication property="principal" var="currentPrincipal" scope="page" />

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<!DOCTYPE html>
<html lang="zh-CN">
<head>

<%@ include file="/WEB-INF/include/meta.jsp"%>
<%@ include file="/WEB-INF/include/css.jsp"%>

</head>

<body class="x-theme-draft">

  <%@ include file="/WEB-INF/include/header.jsp"%>
  <%@ include file="/WEB-INF/include/submenu.jsp"%>

  <div class="container-fluid x-container has-x-sidemenu">

    <ol class="x-breadcrumb breadcrumb">
      <li class="active">赌局管理&nbsp;&nbsp;-&nbsp;&nbsp;详情</li>
    </ol>

    <div class="x-content-layout ">

      <div class="form-horizontal x-form">
        <div class="block-heading">
          <h5>赌局信息</h5>
        </div>
        
        <div class="form-group x-form-group">
          <label class="control-label col-xs-2" style="width: 8%">赌局名称：</label>
          <div class="col-xs-2">
            <p class="form-control-static">${bet.name}</p>
          </div>
        </div>
        
        <div class="form-group x-form-group">
          <label class="control-label col-xs-2" style="width: 8%">活动封面：</label>
          <div class="col-xs-3">
            <p class="form-control-static">
              <img src="${bet.avatar}" style="width: 100%;">&nbsp;&nbsp;&nbsp;
            </p>
          </div>
        </div>

        <div class="form-group x-form-group">
          <label class="control-label col-xs-2" style="width: 8%">奖金池：</label>
          <div class="col-xs-2">
            <p class="form-control-static">${bet.bonus}</p>
          </div>

          <label class="control-label col-xs-2" style="width: 8%">参与人数：</label>
          <div class="col-xs-2">
            <p class="form-control-static">${bet.thumbAmount}</p>
          </div>
        </div>

        <div class="form-group x-form-group">
          <label class="control-label col-xs-2" style="width: 8%">开始时间：</label>
          <div class="col-xs-2">
            <p class="form-control-static">
              <fmt:formatDate value="${bet.startDate}" pattern="yyyy-MM-dd" />
            </p>
          </div>

          <label class="control-label col-xs-2" style="width: 8%">状态：</label>
          <div class="col-xs-2">
            <p class="form-control-static">${bet.status.alias}</p>
          </div>
        </div>


        

        <div class="block-heading" style="margin-top: 50px;">
          <h5>参与人列表</h5>
        </div>

        <table class="table table-hover x-table">
          <thead>
            <tr>
              <th>序号</th>
              <th>名称</th>
              <th>手机</th>
              <th>挑战前</th>
              <th>挑战后</th>
              <th>看好人数</th>
              <th>不好人数</th>
              <th>状态</th>
              <th>是否成功</th>
              <th>参与时间</th>
            </tr>
          </thead>
          <tbody>
            <c:forEach items="${userBets}" var="userBet" varStatus="status">
              <tr>
                <td>${status.index+1}</td>
                <td>${userBet.user.nickname}</td>
                <td>${userBet.user.mobile}</td>
                <td>
                  <c:if test="${not empty userBet.beforeWeight}">
                    ${userBet.beforeWeight}&nbsp;KG <br />
                    <a target="_BLANK" href="${cloud.video}/${userBet.beforeVedio}">${userBet.beforeVedio}</a>
                  </c:if>
                  <c:if test="${empty userBet.beforeWeight}">
                    暂未上传
                  </c:if>
                </td>
                <td>
                  <c:if test="${not empty userBet.afterWeight}">
                    ${userBet.afterWeight}&nbsp;KG <br />
                    <a target="_BLANK" href="${cloud.video}/${userBet.afterVedio}">${userBet.afterVedio}</a>
                  </c:if>
                  <c:if test="${empty userBet.afterWeight}">
                    暂未上传
                  </c:if>
                </td>
                <td>${userBet.thumbup}</td>
                <td>${userBet.thumbdown}</td>
                <td>${userBet.status.description}</td>
                <td>
                  <c:if test="${userBet.status eq 'FINISHED'}">
                    ${userBet.success ? '挑战成功' : '挑战失败'}
                  </c:if>
                  <c:if test="${userBet.status  != 'FINISHED'}">
                    结果未知
                  </c:if>
                </td>
                <td>
                  <fmt:formatDate value="${userBet.createTime}" pattern="yyyy-MM-dd" />
                </td>
              </tr>

            </c:forEach>

          </tbody>

        </table>

      </div>
    </div>
  </div>

  <%@ include file="/WEB-INF/include/script.jsp"%>
<!--  <d:resource type="script" root="${ctx.resource}/build" src="js/page/order/order-view.js" />
  <script type="text/javascript">
     require(['page/order/order-view'], function (page) {
       page.init()
     })
  </script>-->

</body>
</html>